package com.spade.provider;

import org.springframework.stereotype.Service;

/**
 * @author quanlong.chan
 * @Title: DemoServiceImpl
 * @Description:
 * @date 2019/8/1 10:40
 */
@Service
public class ProviderServiceImpl implements ProviderService {

    private static final String BOOME = "boom";

    @Override
    public String sayHello(String name) {

        boomSleep(name);

        String str = "hello " + name;
        System.out.println(str);
        return str;
    }

    private void boomSleep(String name) {

        if (BOOME.equals(name)) {
            try {
                Thread.sleep(10000L);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
